<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class order_model extends model {
	function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'order';
		parent::__construct();
	}
	
	
	/**
	 * 创建清单
	 * insert($data, $return_insert_id = false, $replace = false)
	 */
	public function add($data) 
	{
		$insertid = $this->insert($data, true);
		if($insertid) {
			$data['id']	= $insertid;
			$data['oid'] = date('ymd', time()) . $insertid;
			$this->update(array('oid' => $data['oid']), 'id='.$insertid);
		}
		 return $data;
	}
}
?>